Optimize the number of calls to fs::metadata
authorAlex Crichton <alex@alexcrichton.com>
Wed, 20 May 2015 06:04:47 +0000 (23:04 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 20 May 2015 06:04:47 +0000 (23:04 -0700)
commite595e877624712b0838c510a827dec08621c9ade
treebf8162583ecd1e941ab30803397ce79d62096fd6
parenta1778efa74b67104d3b91e61c1fc584b72f32f9a
Optimize the number of calls to fs::metadata

When iterating over `DirEntry` values the file type of the entry can typically
be determined without a syscall, so use the new unstable APIs in `std::fs` to
avoid an extra call to `fs::metadata`. When traversing large directory trees the
improvement is quite noticeable!
src/cargo/lib.rs
src/cargo/ops/cargo_read_manifest.rs